package com.trivera.guice;

import static org.mockito.Mockito.verify;

import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import com.google.inject.Guice;
import com.google.inject.Inject;
import com.google.inject.Injector;

public class ATMTest
{
	@Inject
	AutomatedTellerMachine atm;
	
	static Injector injector;
	
	@BeforeClass
	public static void classSetup()
	{
		injector = Guice.createInjector(new ATMJunitModule());
	}
	
	@Before
	public void setup()
	{
		injector.injectMembers(this);
	}
	
	@Test
	public void testNoise()
	{
		System.out.println("testNoise atm: " + atm);
	}
	
	@Test
	public void testDeposit()
	{
		System.out.println("testDeposit atm: " + atm);
		ATMTransport transport = atm.getTransport();
		atm.deposit(5000);
		verify(transport).communicateWithBank(new byte[10]);
	}

}
